// This example shows how to let the user browse for multiple OPC-UA nodes. // // Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . // OPC client and subscriber examples in C# on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-CSharp . // Missing some example? Ask us for it on our Online Forums, https://www.opclabs.com/forum/index ! You do not have to own // a commercial license in order to use Online Forums, and we reply to every post. using System.Windows.Forms; using OpcLabs.EasyOpc.UA.Forms.Browsing; namespace UAFormsDocExamples._UABrowseDialog { static partial class ShowDialog { public static void MultiSelect(IWin32Window owner) { var browseDialog = new UABrowseDialog(); browseDialog.InputsOutputs.CurrentNodeDescriptor.EndpointDescriptor.Host = "opcua.demo-this.com"; browseDialog.Mode.AnchorElementType = UAElementType.Host; browseDialog.Mode.MultiSelect = true; DialogResult dialogResult = browseDialog.ShowDialog(owner); if (dialogResult != DialogResult.OK) return; // Display results UABrowseNodeElementCollection selectionElements = browseDialog.Outputs.SelectionElements; string text = ""; for (int i = 0; i < selectionElements.Count; i++) { UABrowseNodeElement selectionElement = selectionElements[i]; text += $"SelectionElements({i}): {selectionElement.NodeElement}\r\n"; } MessageBox.Show(owner, text); } } }
' This example shows how to let the user browse for an OPC-UA node. ' ' Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . ' OPC client and subscriber examples in VB.NET on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-VBNET . ' Missing some example? Ask us for it on our Online Forums, https://www.opclabs.com/forum/index ! You do not have to own ' a commercial license in order to use Online Forums, and we reply to every post. Imports OpcLabs.EasyOpc.UA.Forms.Browsing Namespace UAFormsDocExamples._UABrowseDialog Friend Class ShowDialog Shared Sub Main1(owner As IWin32Window) Dim browseDialog = New UABrowseDialog() browseDialog.InputsOutputs.CurrentNodeDescriptor.EndpointDescriptor.Host = "opcua.demo-this.com" browseDialog.Mode.AnchorElementType = UAElementType.Host Dim dialogResult As DialogResult = browseDialog.ShowDialog(owner) If dialogResult <> DialogResult.OK Then Return End If ' Display results MessageBox.Show(owner, browseDialog.Outputs.CurrentNodeElement.NodeElement.ToString()) End Sub End Class End Namespace
Rem This example shows how to let the user browse for multiple OPC-UA nodes. Rem Rem Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . Rem OPC client and subscriber examples in VBScript on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-VBScript . Rem Missing some example? Ask us for it on our Online Forums, https://www.opclabs.com/forum/index ! You do not have to own Rem a commercial license in order to use Online Forums, and we reply to every post. Option Explicit Const DialogResult_OK = 1 Const UAElementType_Host = 1 Dim BrowseDialog: Set BrowseDialog = CreateObject("OpcLabs.EasyOpc.UA.Forms.Browsing.UABrowseDialog") BrowseDialog.InputsOutputs.CurrentNodeDescriptor.EndpointDescriptor.Host = "opcua.demo-this.com" BrowseDialog.Mode.AnchorElementType = UAElementType_Host BrowseDialog.Mode.MultiSelect = True Dim dialogResult: dialogResult = BrowseDialog.ShowDialog WScript.Echo dialogResult If dialogResult <> DialogResult_OK Then WScript.Quit End If ' Display results Dim SelectionElements: Set SelectionElements = BrowseDialog.Outputs.SelectionElements Dim i: For i = 0 To SelectionElements.Count - 1 Dim Element: Set Element = SelectionElements(i) WScript.Echo "SelectionElements(" & i & "): " & Element.NodeElement Next
# This example shows how to let the user browse for an OPC-UA node. # # Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . # OPC client and subscriber examples in Python on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-Python . # Missing some example? Ask us for it on our Online Forums, https://www.opclabs.com/forum/index ! You do not have to own # a commercial license in order to use Online Forums, and we reply to every post. # The QuickOPC package is needed. Install it using "pip install opclabs_quickopc". import opclabs_quickopc # Import .NET namespaces. from System.Windows.Forms import * from OpcLabs.EasyOpc.UA.Forms.Browsing import * browseDialog = UABrowseDialog() browseDialog.InputsOutputs.CurrentNodeDescriptor.EndpointDescriptor.Host = 'opcua.demo-this.com' browseDialog.Mode.AnchorElementType = UAElementType.Host dialogResult = browseDialog.ShowDialog() print(dialogResult) if dialogResult != DialogResult.OK: exit() # Display results. print(browseDialog.Outputs.CurrentNodeElement.NodeElement) print('Finished.')
Copyright © 2004-2024 CODE Consulting and Development, s.r.o., Plzen. All rights reserved.
Documentation Home, Send Documentation Feedback. Technical Support